import 'package:flutter/material.dart';

class PageviewPage extends StatefulWidget {
  const PageviewPage({super.key});

  @override
  State<PageviewPage> createState() => _PageviewPageState();
}

class _PageviewPageState extends State<PageviewPage> {
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: Text('page demo'),
      ),
      body: PageView(
        scrollDirection: Axis.vertical,//默认水平
        children: const [
          Center(
              child: Text(
            '界面1',
            style: TextStyle(fontSize: 20, color: Colors.red),
          )),
          Center(
              child: Text(
            '界面2',
            style: TextStyle(fontSize: 20, color: Colors.red),
          )),
          Center(
              child: Text(
            '界面3',
            style: TextStyle(fontSize: 20, color: Colors.red),
          )),
        ],
      ),
    );
  }
}
